package service.imppl;

import dao.IBusinessManagementDao;
import dao.impl.BusinessManagementDao;
import pojo.Businesses;
import service.IBusinessManagementService;
import util.PageHelper;

import java.util.ArrayList;

public class BusinessManagementService implements IBusinessManagementService {
    private IBusinessManagementDao ibmd=new BusinessManagementDao();
    //业务管理
    //业务查看(动态模糊查询,带分页)
    @Override
    public ArrayList<Businesses> queryBusiness(Businesses businesses, PageHelper pageHelper) {
        return ibmd.selectBusinesses(businesses,pageHelper);
    }

    @Override
    public int queryCountBusiness(Businesses businesses) {
        return ibmd.getTotalCount(businesses);
    }

    //创建业务(参数为业务对象)
    @Override
    public boolean addBusiness(Businesses businesses) {
        return ibmd.insertBusiness(businesses)>0;
    }
    //业务信息修改(根据业务ID)
    @Override
    public boolean changeBusiness(Businesses businesses) {
        return ibmd.updateBusiness(businesses)>0;
    }

    @Override
    public boolean removeBusinesses(Integer bId) {
        return ibmd.deleteBusiness(bId)>0;
    }

    @Override
    public ArrayList<Businesses> queryAllBusinesses() {
        return ibmd.selectAllBusinesses();
    }

    @Override
    public ArrayList<Businesses> queryBusinessById(Integer bId) {
        return ibmd.selectBusinessById(bId);
    }
}
